-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: replace static API Request label with customizable animated indicator #7524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…icator - Add AnimatedStatusIndicator component with pulsing animation - Support customizable status texts and emoji mode - Add settings UI for configuring the animated indicator - Include random mode to cycle through messages - Add CSS animations for subtle pulse effect - Integrate with ChatRow to replace static label Implements #7523
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed my own code and found issues I should have caught before pushing. Classic.
| <VSCodeCheckbox | ||
| checked={localConfig.enabled} | ||
| onChange={(e: any) => setLocalConfig((prev) => ({ ...prev, enabled: e.target.checked }))}> | ||
| Enable animated status indicator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing i18n for these UI strings. All user-facing text should use the translation system:
| Enable animated status indicator | |
| {t('settings:animatedStatus.enable')} |
This applies to lines 90, 104, 110, 127, 168, and 174 as well.
| cost?: number | null | ||
| cancelReason?: string | null | ||
| apiRequestFailedMessage?: string | ||
| streamingFailedMessage?: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this streamingFailedMessage prop intentional? It's defined but never used in the component. Could we either use it or remove it to avoid confusion?
| <div className="flex items-center gap-2"> | ||
| <VSCodeCheckbox | ||
| checked={localConfig.enabled} | ||
| onChange={(e: any) => setLocalConfig((prev) => ({ ...prev, enabled: e.target.checked }))}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we improve type safety here? Using any for event handlers reduces TypeScript's ability to catch errors:
| onChange={(e: any) => setLocalConfig((prev) => ({ ...prev, enabled: e.target.checked }))}> | |
| onChange={(e: React.ChangeEvent<HTMLInputElement>) => setLocalConfig((prev) => ({ ...prev, enabled: e.target.checked }))} |
| } | ||
|
|
||
| return ( | ||
| <div className="flex items-center gap-2"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding ARIA labels for better accessibility. Screen readers won't know what this animated indicator represents:
| <div className="flex items-center gap-2"> | |
| <div className="flex items-center gap-2" role="status" aria-label="Loading status"> |
| streamingFailedMessage?: string | ||
| } | ||
|
|
||
| const DEFAULT_STATUS_TEXTS = ["Generating...", "Thinking...", "Working on it...", "Processing...", "Analyzing..."] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These default constants are duplicated in AnimatedStatusSettings.tsx. Could we extract them to a shared constants file to maintain a single source of truth?
| const [newStatusText, setNewStatusText] = useState("") | ||
| const [newEmoji, setNewEmoji] = useState("") | ||
|
|
||
| useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This useEffect triggers on every localConfig change. Since setApiStatusConfig is likely stable, we could optimize by removing it from the dependency array or using useCallback for a more targeted update.
|
Closing, see #7523 (comment) |
Fixes #7523
Summary
This PR replaces the static "API Request" label with a customizable, animated "Generating..." indicator that provides better visual feedback during API requests.
Changes
AnimatedStatusIndicatorcomponent with subtle pulsing animationChatRowto replace the static labelFeatures
Testing
Screenshots
The animated indicator provides visual feedback during API requests with customizable messages and optional emojis.
Related Issue
Closes #7523
Important
Replaces static API request label with
AnimatedStatusIndicator, adding customizable animations and settings integration.AnimatedStatusIndicatorinChatRow.tsx.AnimatedStatusIndicatorinAnimatedStatusIndicator.tsxshows customizable, animated status during API requests.AnimatedStatusSettingsinAnimatedStatusSettings.tsxfor configuring status indicator.ExperimentalSettings.tsxandSettingsView.tsx.apiStatusConfigtoExtensionStateContext.tsxfor managing indicator settings.pulse-subtleinindex.cssfor subtle pulsing effect.This description was created by
for 4ed2a3d. You can customize this summary. It will automatically update as commits are pushed.